package com.b.repository;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.SearchPage;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import com.b.domain.Video;

import java.util.List;

public interface VideoRepository extends ElasticsearchRepository<Video, Integer> {
    SearchPage<Video> findByCategoryId(Integer CategoryId, PageRequest pageRequest);

    // 新增：按categoryId和result not in过滤
    SearchPage<Video> findByCategoryIdAndResultNotIn(Integer categoryId, List<String> result, PageRequest pageRequest);

    Video findByIdAndTitleLike(Integer id, String title);
}
